package biz;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import dao.TeacherDao;
import entity.Teacher;
import util.SessionFactory;

public class TeacherBiz {
	private TeacherDao dao;
	public List<Teacher> selectAllTeacher(){
		List<Teacher> list = null;
		SqlSession session = null;
		try {
			session = SessionFactory.SqlSessionFactory();
			dao = session.getMapper(TeacherDao.class);
			list = dao.selectAllTeacher();
			session.close();
		}
		catch(Exception e) {
			session.rollback();
			session.close();
		}
		return list;
	}
}
